<template>
    <div >
         <mt-header title="未审核" >
                <router-link to="/index" slot="left">
                    <mt-button icon="back">返回</mt-button>
                </router-link>                  
            </mt-header>
            <!-- <article-component :notAuditShow="isAuditShow" :article="msg"></article-component>        -->
         <ul>
             <li v-for="item in list" @click="">
                        <!-- <img src="../assets/img/error.png" alt="" class="error" v-show="notAuditShow"> -->
                <div class="bblock" :class="{Bblock:isShow}" >
                    <div class="btop">
                        <span class="left" >校园新闻</span>
                        <span class="right" >{{item.time}}</span>
                                <!-- <h1>{{item.imgs[0]}}</h1> -->
                        <p class="clear"></p>
                    </div>
                    <div class="bbottom" @click="jumpTo(item.title,item.desc,item.id,item.imgs)">
                                <!-- <h1>{{item.id}}</h1> -->
                        <h3 >{{item.title}}</h3>
                        <h3  v-html='item.desc' class='auditList'></h3>
                        <div v-if="item.imgs.length>0" >                        
                            <img style='width:7rem;height:5rem' :src="item.imgs[0].src" alt="">
                        </div>
                    </div>
                        <i class="el-icon-close" @click="deleteNews(item.id)" style="color:red "></i>
                    </div>
                         <!-- <p class="comment" v-show="notAuditShow">{{$store.state.problem}}</p> -->
                </li>
            </ul>

    </div>
</template>
<script>
import ArticleComponent from './ArticleComponent'
    export default{
        data(){
            return{
               isAuditShow:false,
                msg:'未审核',
                list:[],
                Plist:[],
                isShow:true,
            }
        },
        methods:{
            //校园新闻/随手拍列表请求
            requestNews(){
                  var url="http://125.210.160.93:8080/SmEdu/pass/news/NOT";
                   this.$http.post(url,{schoId:19,pageNum:1,pageSize:100}).then((res)=>{
                   console.log(res);
                   console.log(res.data.body);
                   this.list=res.data.body;
                }).catch((err)=>{
                    console.log(err);
                })
            },
            //单个删除校园通知
            deleteNews(id){
                var url="http://125.210.160.93:8080/SmEdu/priv/news/doDelete";
                this.$http.post(url,{id}).then((res)=>{
                    console.log(res);
                    this.requestNews();
                }).catch((err)=>{
                    console.log(err);
                })
            },
            //单个删除校园随手拍
            deleteNewsP(id){
                var url="http://125.210.160.93:8080/SmEdu/priv/news/doDelete";
                this.$http.post(url,{id}).then((res)=>{
                    console.log(res);
                    this.requestNewsP();
                }).catch((err)=>{
                    console.log(err);
                })
            },
            //跳转审核页
            jumpTo(title,content,id,src){
                this.$router.push({path:'/index/notaudit/notauditpage',query:{title,content,id,src}})
            },
        },
        components:{
            ArticleComponent
        },
        created(){
            this.requestNews();
        }
    }
</script>
<style>
    .auditList>img{
        width:7rem !important;
        height:5rem !important;
    }
</style>


